From e89f439a07a51059784af0ed07d577c5ff96fad5 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sat, 25 Aug 2007 18:29:47 +0000 Subject: [PATCH] * CDBS class - add support for automatic ocamldoc HTML documentation generation --- debian/cdbs/ocaml-vars.mk | 20 +++++++++++++++++++- debian/cdbs/ocaml.mk | 18 ++++++++++++++++-- debian/changelog | 4 +++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/debian/cdbs/ocaml-vars.mk b/debian/cdbs/ocaml-vars.mk index 67255b2b..d889c9c9 100644 --- a/debian/cdbs/ocaml-vars.mk +++ b/debian/cdbs/ocaml-vars.mk @@ -16,7 +16,7 @@ # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# $Id: ocaml-vars.mk 3889 2007-07-04 10:48:53Z zack $ +# $Id: ocaml-vars.mk 4191 2007-08-25 18:29:47Z zack $ _cdbs_scripts_path ?= /usr/lib/cdbs _cdbs_rules_path ?= /usr/share/cdbs/1/rules @@ -70,5 +70,23 @@ OCAML_TEAM += Sven Luther , OCAML_TEAM += Sylvain Le Gall # no trailing "," (comma) on the last name +# space separated list of packages matching the naming convention for OCaml +# libraries, i.e. libXXX-ocaml-dev. +# For debian/rules writers +OCAML_DEV_PACKAGES := $(filter lib%-ocaml-dev,$(DEB_PACKAGES)) + +# space separated list of packages on which ocamldoc usage is required. For +# each package listed here will have ocamldoc invoked on all *.ml/*.mli files +# installed under $(OCAML_STDLIB_DIR) to generated html documentation which +# will be shipped in /usr/share/doc/PACKAGE/html/*. +# Typical usage is OCAML_OCAMLDOC_PACKAGES = $(OCAML_DEV_PACKAGES). +# For debian/rules writers +OCAML_OCAMLDOC_PACKAGES = +#OCAML_OCAMLDOC_PACKAGES = $(OCAML_DEV_PACKAGES) # more "aggressive" default + +# flags to be passed to ocamldoc (in addition to -html and -d DESTDIR). +# For debian/rules writers +OCAML_OCAMLDOC_FLAGS = -stars + endif diff --git a/debian/cdbs/ocaml.mk b/debian/cdbs/ocaml.mk index ad65fd01..3de0323c 100644 --- a/debian/cdbs/ocaml.mk +++ b/debian/cdbs/ocaml.mk @@ -16,7 +16,7 @@ # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# $Id: ocaml.mk 3889 2007-07-04 10:48:53Z zack $ +# $Id: ocaml.mk 4191 2007-08-25 18:29:47Z zack $ _cdbs_scripts_path ?= /usr/lib/cdbs _cdbs_rules_path ?= /usr/share/cdbs/1/rules @@ -34,12 +34,26 @@ CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), ocaml-nox # import OCAML_* make variables include $(_cdbs_class_path)/ocaml-vars.mk$(_cdbs_makefile_suffix) -# ensure dpkg-gencontrol will fill F:OCamlABI fields with the proper value ifdef _cdbs_rules_debhelper + +# ensure dpkg-gencontrol will fill F:OCamlABI fields with the proper value DEB_DH_GENCONTROL_ARGS += -- -VF:OCamlABI="$(OCAML_ABI)" DEB_DH_GENCONTROL_ARGS += -VF:OCamlNativeArchs="$(OCAML_NATIVE_ARCHS)" + endif +# post-install hooks for invoking ocamldoc on OCAML_OCAMLDOC_PACKAGES packages +$(patsubst %,install/%,$(DEB_PACKAGES)):: + @if (echo $(OCAML_OCAMLDOC_PACKAGES) | grep -w '$(cdbs_curpkg)' > /dev/null) ; then \ + echo 'mkdir -p debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html' ; \ + mkdir -p debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html ; \ + echo 'invoking ocamldoc on debian/$(cdbs_curpkg)$(OCAML_STDLIB_DIR)/ ...' ; \ + find debian/$(cdbs_curpkg)$(OCAML_STDLIB_DIR)/ \ + -type f -name '*.mli' -or -name '*.ml' \ + | xargs ocamldoc $(OCAML_OCAMLDOC_FLAGS) -html \ + -d debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/html ; \ + fi + # generate .in files counterpars before building, substituting @OCamlABI@ # markers with the proper value; clean stamps after building pre-build:: ocamlinit diff --git a/debian/changelog b/debian/changelog index f09489b8..d37e4b5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ ocaml (3.10.0-6) UNRELEASED; urgency=low [ Stefano Zacchiroli ] * debian/ocaml-nox.dirs.in - avoid creating empty /usr/include/ocaml/* directory (closes: #439017) + * CDBS class + - add support for automatic ocamldoc HTML documentation generation - -- Stefano Zacchiroli Tue, 21 Aug 2007 18:55:16 +0200 + -- Stefano Zacchiroli Sat, 25 Aug 2007 20:28:29 +0200 ocaml (3.10.0-5) experimental; urgency=low -- 2.30.2